//
//  NSAttributedString+Common.m
//  Tools
//
//  Created by han on 2019/2/14.
//  Copyright © 2019 han. All rights reserved.
//

#import "NSAttributedString+Common.h"

@implementation NSAttributedString (Common)

- (CGSize)getSizeWithConstrainedToSize:(CGSize)size {
    CGSize titleSize = [self boundingRectWithSize:size options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading context:0].size;
    return titleSize;
}
- (CGFloat)getHeightWithConstrainedToSize:(CGSize)size {
    return [self getSizeWithConstrainedToSize:size].height;
}

@end
